package com.example.drainage.ui.realmdao

import android.os.Bundle
import com.example.arm.base.BaseActivity
import com.example.arm.ext.viewModelKt
import com.example.drainage.databinding.ActivityRealmDaoBinding

/**
 *  author : yanghaozhang
 *  date : 2022/8/3 15:47
 *  description :
 */
class RealmDaoActivity : BaseActivity<ActivityRealmDaoBinding>() {

    private val viewModel: RealmDaoViewModel by viewModelKt {
        RealmDaoViewModel()
    }

    override fun initView(savedInstanceState: Bundle?): ActivityRealmDaoBinding {
        return ActivityRealmDaoBinding.inflate(layoutInflater)
    }

    override fun initData(savedInstanceState: Bundle?) {
        binding.apply {
            testAdd.setOnClickListener {
                viewModel.testAdd()
            }
            testDelete.setOnClickListener {
                viewModel.testDelete()
            }
            testDeleteAll.setOnClickListener {
                viewModel.testDeleteAll()
            }
        }
    }
}